The wall of the heart is made of muscle, and it is the contraction of this muscle in a set pattern that causes the heart to beat and pump blood around the body. As with any muscle the heart muscle is stimulated to contract by a small electrical impulse, and this impulse can be detected and used to produce an electrocardiogram of voltage against time which indicates the beat rhythm.